/*
 * DrummondCO2Model.cpp
 *
 *  Created on: 1 Aug 2011
 *      Author: Allan
 */

#include "DrummondCO2Model.h"

// GeoReact includes
#include "Geochemistry/ElectrolyteSolution.h"

const double DrummondCO2ActivityCoefficient(const ElectrolyteSolution& sol, double T, double P, const VectorXd& n)
{
	// The temperature in degrees Kelvin
	const double Tk = T + 273.15;
	
	// The effective ionic strength of the solution
	const double I = sol.StoichiometricIonicStrength(n);
	
	// The activity coefficient of aqueous CO2 computed with Drummond's model
	const double gCO2aq = std::exp((-1.0312 + 1.2806E-3*Tk + 255.9/Tk) * I - (0.4445 - 1.606E-3*Tk) * I/(I + 1.0));
	
	return gCO2aq;
}

